package com.gfhd.rabbitmq.service;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SpringAmqpSendDemo1 {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    public void test(){
        String queueName = "simple.queue";
        String message = "你好";
        rabbitTemplate.convertAndSend(queueName,message);
    }
}
